/*
 * Amazon Ads API - Sponsored Products
 * Use the Amazon Ads API for Sponsored Products for campaign, ad group, keyword, negative keyword, and product ad management operations. For more information about Sponsored Products, see the [Sponsored Products Support Center](https://advertising.amazon.com/help?entityId=ENTITY3CWETCZD9HEG2#GWGFKPEWVWG2CLUJ). For onboarding information, see the [account setup](setting-up/account-setup) topic.<br/><br/> 
 *
 * The version of the OpenAPI document: 2.0
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package org.openapitools.client.model;

import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.openapitools.client.model.Bidding;
import org.openapitools.client.model.State;
import org.openapitools.jackson.nullable.JsonNullable;

/**
 * CreateCampaign
 */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2022-04-12T19:05:39.971406+08:00[Asia/Shanghai]")
public class CreateCampaign {
  public static final String SERIALIZED_NAME_PORTFOLIO_ID = "portfolioId";
  @SerializedName(SERIALIZED_NAME_PORTFOLIO_ID)
  private BigDecimal portfolioId;

  public static final String SERIALIZED_NAME_NAME = "name";
  @SerializedName(SERIALIZED_NAME_NAME)
  private String name;

  public static final String SERIALIZED_NAME_TAGS = "tags";
  @SerializedName(SERIALIZED_NAME_TAGS)
  private Map<String, String> tags = null;

  /**
   * The advertising product managed by this campaign.
   */
  @JsonAdapter(CampaignTypeEnum.Adapter.class)
  public enum CampaignTypeEnum {
    SPONSOREDPRODUCTS("sponsoredProducts");

    private String value;

    CampaignTypeEnum(String value) {
      this.value = value;
    }

    public String getValue() {
      return value;
    }

    @Override
    public String toString() {
      return String.valueOf(value);
    }

    public static CampaignTypeEnum fromValue(String value) {
      for (CampaignTypeEnum b : CampaignTypeEnum.values()) {
        if (b.value.equals(value)) {
          return b;
        }
      }
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }

    public static class Adapter extends TypeAdapter<CampaignTypeEnum> {
      @Override
      public void write(final JsonWriter jsonWriter, final CampaignTypeEnum enumeration) throws IOException {
        jsonWriter.value(enumeration.getValue());
      }

      @Override
      public CampaignTypeEnum read(final JsonReader jsonReader) throws IOException {
        String value =  jsonReader.nextString();
        return CampaignTypeEnum.fromValue(value);
      }
    }
  }

  public static final String SERIALIZED_NAME_CAMPAIGN_TYPE = "campaignType";
  @SerializedName(SERIALIZED_NAME_CAMPAIGN_TYPE)
  private CampaignTypeEnum campaignType;

  /**
   * The type of targeting for the campaign.
   */
  @JsonAdapter(TargetingTypeEnum.Adapter.class)
  public enum TargetingTypeEnum {
    MANUAL("manual"),
    
    AUTO("auto");

    private String value;

    TargetingTypeEnum(String value) {
      this.value = value;
    }

    public String getValue() {
      return value;
    }

    @Override
    public String toString() {
      return String.valueOf(value);
    }

    public static TargetingTypeEnum fromValue(String value) {
      for (TargetingTypeEnum b : TargetingTypeEnum.values()) {
        if (b.value.equals(value)) {
          return b;
        }
      }
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }

    public static class Adapter extends TypeAdapter<TargetingTypeEnum> {
      @Override
      public void write(final JsonWriter jsonWriter, final TargetingTypeEnum enumeration) throws IOException {
        jsonWriter.value(enumeration.getValue());
      }

      @Override
      public TargetingTypeEnum read(final JsonReader jsonReader) throws IOException {
        String value =  jsonReader.nextString();
        return TargetingTypeEnum.fromValue(value);
      }
    }
  }

  public static final String SERIALIZED_NAME_TARGETING_TYPE = "targetingType";
  @SerializedName(SERIALIZED_NAME_TARGETING_TYPE)
  private TargetingTypeEnum targetingType;

  public static final String SERIALIZED_NAME_STATE = "state";
  @SerializedName(SERIALIZED_NAME_STATE)
  private State state;

  public static final String SERIALIZED_NAME_DAILY_BUDGET = "dailyBudget";
  @SerializedName(SERIALIZED_NAME_DAILY_BUDGET)
  private Float dailyBudget;

  public static final String SERIALIZED_NAME_START_DATE = "startDate";
  @SerializedName(SERIALIZED_NAME_START_DATE)
  private String startDate;

  public static final String SERIALIZED_NAME_END_DATE = "endDate";
  @SerializedName(SERIALIZED_NAME_END_DATE)
  private String endDate;

  public static final String SERIALIZED_NAME_PREMIUM_BID_ADJUSTMENT = "premiumBidAdjustment";
  @SerializedName(SERIALIZED_NAME_PREMIUM_BID_ADJUSTMENT)
  private Boolean premiumBidAdjustment;

  public static final String SERIALIZED_NAME_BIDDING = "bidding";
  @SerializedName(SERIALIZED_NAME_BIDDING)
  private Bidding bidding;


  public CreateCampaign portfolioId(BigDecimal portfolioId) {
    
    this.portfolioId = portfolioId;
    return this;
  }

   /**
   * The identifier of an existing portfolio to which the campaign is associated.
   * @return portfolioId
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The identifier of an existing portfolio to which the campaign is associated.")

  public BigDecimal getPortfolioId() {
    return portfolioId;
  }


  public void setPortfolioId(BigDecimal portfolioId) {
    this.portfolioId = portfolioId;
  }


  public CreateCampaign name(String name) {
    
    this.name = name;
    return this;
  }

   /**
   * A name for the campaign. Note that idempotency for this field works different for sellers and vendors. Sellers aren&#39;t allowed to have duplicate campaign names, but vendors can have duplicate campaign names.
   * @return name
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "A name for the campaign. Note that idempotency for this field works different for sellers and vendors. Sellers aren't allowed to have duplicate campaign names, but vendors can have duplicate campaign names.")

  public String getName() {
    return name;
  }


  public void setName(String name) {
    this.name = name;
  }


  public CreateCampaign tags(Map<String, String> tags) {
    
    this.tags = tags;
    return this;
  }

  public CreateCampaign putTagsItem(String key, String tagsItem) {
    if (this.tags == null) {
      this.tags = new HashMap<String, String>();
    }
    this.tags.put(key, tagsItem);
    return this;
  }

   /**
   * A list of advertiser-specified custom identifiers for the campaign. Each customer identifier is a key-value pair. You can specify a maximum of 50 identifiers.
   * @return tags
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "{\"PONumber\":\"examplePONumber\",\"accountManager\":\"exampleAccountManager\"}", value = "A list of advertiser-specified custom identifiers for the campaign. Each customer identifier is a key-value pair. You can specify a maximum of 50 identifiers.")

  public Map<String, String> getTags() {
    return tags;
  }


  public void setTags(Map<String, String> tags) {
    this.tags = tags;
  }


  public CreateCampaign campaignType(CampaignTypeEnum campaignType) {
    
    this.campaignType = campaignType;
    return this;
  }

   /**
   * The advertising product managed by this campaign.
   * @return campaignType
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The advertising product managed by this campaign.")

  public CampaignTypeEnum getCampaignType() {
    return campaignType;
  }


  public void setCampaignType(CampaignTypeEnum campaignType) {
    this.campaignType = campaignType;
  }


  public CreateCampaign targetingType(TargetingTypeEnum targetingType) {
    
    this.targetingType = targetingType;
    return this;
  }

   /**
   * The type of targeting for the campaign.
   * @return targetingType
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The type of targeting for the campaign.")

  public TargetingTypeEnum getTargetingType() {
    return targetingType;
  }


  public void setTargetingType(TargetingTypeEnum targetingType) {
    this.targetingType = targetingType;
  }


  public CreateCampaign state(State state) {
    
    this.state = state;
    return this;
  }

   /**
   * Get state
   * @return state
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public State getState() {
    return state;
  }


  public void setState(State state) {
    this.state = state;
  }


  public CreateCampaign dailyBudget(Float dailyBudget) {
    
    this.dailyBudget = dailyBudget;
    return this;
  }

   /**
   * A daily budget for the campaign.
   * @return dailyBudget
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "A daily budget for the campaign.")

  public Float getDailyBudget() {
    return dailyBudget;
  }


  public void setDailyBudget(Float dailyBudget) {
    this.dailyBudget = dailyBudget;
  }


  public CreateCampaign startDate(String startDate) {
    
    this.startDate = startDate;
    return this;
  }

   /**
   * A starting date for the campaign to go live. The format of the date is YYYYMMDD.
   * @return startDate
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "A starting date for the campaign to go live. The format of the date is YYYYMMDD.")

  public String getStartDate() {
    return startDate;
  }


  public void setStartDate(String startDate) {
    this.startDate = startDate;
  }


  public CreateCampaign endDate(String endDate) {
    
    this.endDate = endDate;
    return this;
  }

   /**
   * An ending date for the campaign to stop running. The format of the date is YYYYMMDD.
   * @return endDate
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "An ending date for the campaign to stop running. The format of the date is YYYYMMDD.")

  public String getEndDate() {
    return endDate;
  }


  public void setEndDate(String endDate) {
    this.endDate = endDate;
  }


  public CreateCampaign premiumBidAdjustment(Boolean premiumBidAdjustment) {
    
    this.premiumBidAdjustment = premiumBidAdjustment;
    return this;
  }

   /**
   * If set to true, Amazon increases the default bid for ads that are eligible to appear in this placement. See developer notes for more information.
   * @return premiumBidAdjustment
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "If set to true, Amazon increases the default bid for ads that are eligible to appear in this placement. See developer notes for more information.")

  public Boolean getPremiumBidAdjustment() {
    return premiumBidAdjustment;
  }


  public void setPremiumBidAdjustment(Boolean premiumBidAdjustment) {
    this.premiumBidAdjustment = premiumBidAdjustment;
  }


  public CreateCampaign bidding(Bidding bidding) {
    
    this.bidding = bidding;
    return this;
  }

   /**
   * Get bidding
   * @return bidding
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Bidding getBidding() {
    return bidding;
  }


  public void setBidding(Bidding bidding) {
    this.bidding = bidding;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    CreateCampaign createCampaign = (CreateCampaign) o;
    return Objects.equals(this.portfolioId, createCampaign.portfolioId) &&
        Objects.equals(this.name, createCampaign.name) &&
        Objects.equals(this.tags, createCampaign.tags) &&
        Objects.equals(this.campaignType, createCampaign.campaignType) &&
        Objects.equals(this.targetingType, createCampaign.targetingType) &&
        Objects.equals(this.state, createCampaign.state) &&
        Objects.equals(this.dailyBudget, createCampaign.dailyBudget) &&
        Objects.equals(this.startDate, createCampaign.startDate) &&
        Objects.equals(this.endDate, createCampaign.endDate) &&
        Objects.equals(this.premiumBidAdjustment, createCampaign.premiumBidAdjustment) &&
        Objects.equals(this.bidding, createCampaign.bidding);
  }

  private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
    return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
  }

  @Override
  public int hashCode() {
    return Objects.hash(portfolioId, name, tags, campaignType, targetingType, state, dailyBudget, startDate, endDate, premiumBidAdjustment, bidding);
  }

  private static <T> int hashCodeNullable(JsonNullable<T> a) {
    if (a == null) {
      return 1;
    }
    return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class CreateCampaign {\n");
    sb.append("    portfolioId: ").append(toIndentedString(portfolioId)).append("\n");
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    tags: ").append(toIndentedString(tags)).append("\n");
    sb.append("    campaignType: ").append(toIndentedString(campaignType)).append("\n");
    sb.append("    targetingType: ").append(toIndentedString(targetingType)).append("\n");
    sb.append("    state: ").append(toIndentedString(state)).append("\n");
    sb.append("    dailyBudget: ").append(toIndentedString(dailyBudget)).append("\n");
    sb.append("    startDate: ").append(toIndentedString(startDate)).append("\n");
    sb.append("    endDate: ").append(toIndentedString(endDate)).append("\n");
    sb.append("    premiumBidAdjustment: ").append(toIndentedString(premiumBidAdjustment)).append("\n");
    sb.append("    bidding: ").append(toIndentedString(bidding)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

}

